package 统计算法.可被K整除的最小整数;

public class kbkzcdzxzs {
    public static void main(String[] args) {
        System.out.println(smallestRepunitDivByK(17));
    }
    public static int smallestRepunitDivByK(int k) {
        if (k % 2 == 0 || k % 5 == 0) {
            return -1;
        }

        int x = 1;
        int res = 1;
        while (x % k != 0) {
//            这里暂时没懂
            x = x % k;
            x = x * 10 + 1;
            res++;
        }
        return res;

    }
}
